﻿/****************************************************************
Architecture:
Mohammad Ashraful Alam, Microsoft MVP 2007-2010
Portfolio: http://www.ashraful.net
***************************************************************/
using System.Collections.Generic;
using System.Linq;
using DaXDD.DataContainers;
using DaXDD.DataAccess.Model.IDataAccess;
using DaXDD.InMemoryDatabase;
namespace DaXDD.DataAccess.Model.InMemoryDataAccess
{
    public partial class EmployeeDAO:IEmployeeDAO
    {
        public Employee GetEmployeeByEmployeeId(int employeeId)
        {
            return InMemoryDataSource.Employees.FirstOrDefault(employeeObj => employeeObj.EmployeeId == employeeId);
        }

        public int CreateNewEmployee(Employee newEmployee)
        {
            InMemoryDataSource.Employees.Add(newEmployee);
            return 1;
        }

        public bool UpdateEmployee(Employee updatedEmployee)
        {
            InMemoryDataSource.EmployeeUpdateInMemory(updatedEmployee);
            return true;
        }

        public bool DeleteEmployee(Employee toBeDeletedEmployee)
        {
            InMemoryDataSource.Employees.RemoveAll(employeeObj => employeeObj.EmployeeId == toBeDeletedEmployee.EmployeeId);
            return true;
        }

        public List<Employee> GetAllEmployees()
        {
            return InMemoryDataSource.Employees;
        }

        public List<Employee> GetAllEmployeesPaged(string orderBy, int startRowIndex, int maximumRows)
        {
            throw new System.NotImplementedException();
        }

        public int GetAllEmployeesPagedCount(string orderBy, int startRowIndex, int maximumRows)
        {
            throw new System.NotImplementedException();
        }

        public List<Employee> GetEmployeesByReportsTo(int? reportsTo)
        {
            throw new System.NotImplementedException();
        }

        public List<Employee> GetEmployeesByReportsToPaged(int? reportsTo, string orderBy, int startRowIndex, int maximumRows)
        {
            throw new System.NotImplementedException();
        }

        public bool DeleteEmployees(System.Collections.ObjectModel.Collection<int> employeesIdsToDelete)
        {
            throw new System.NotImplementedException();
        }
        
        public int GetEmployeesByReportsToPagedCount(int? reportsTo, string orderBy, int startRowIndex, int maximumRows)
        {
            throw new System.NotImplementedException();
        }
    }
}
